<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<!-- base href="http://localhost:8080/MyCommunity/" -->
    <title>首页：欢迎光临XDA论坛</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.css" rel="stylesheet" media="screen">
    <!-- Custom CSS -->
    <link href="${pageContext.request.contextPath}/static/css/main.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.js"></script>
</head>
<body>
    <div class="container">
  		

<header>
    <div id="logo">
        <img src="${pageContext.request.contextPath}/static/img/logo.png" alt="">
    </div>
    <nav class="navbar navbar-default">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-menu">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
            <a class="navbar-brand" href="#">首页</a>
        </div>
        <div class="collapse navbar-collapse" id="navbar-collapse-menu">
        	
            <ul class="nav navbar-nav">
                <li class="active"><a href="http://localhost:8080/MyCommunity/personal">个人主页</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">我的邮箱<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a href="http://localhost:8080/MyCommunity/message/receive_list">收件箱</a></li>
                        <li><a href="http://localhost:8080/MyCommunity/message/send_list">发件箱</a></li>
                        <li class="divider"></li>
                        <li><a href="http://localhost:8080/MyCommunity/message/create">编写新邮件</a></li>
                    </ul>
                </li>
                <li>
                	
                	<a href="http://localhost:8080/MyCommunity/create_topic">发表主题</a>
                	
                </li>
            </ul>
            
            <form action="search_result" method="get" class="navbar-form navbar-left" role="search">
                <div class="form-group">
                    <input name="title" class="form-control" placeholder="主题" type="text">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
            
            
            	<li><a href="loginOut">注销</a></li>
            	<li><a>${loginUser.nickname}</a></li>
			
            </ul>
        </div>
    </nav>
</header>
    
    	<div class="content">
        	


<div class="row">
    <div class="col-lg-6">
		<div id="banner" class="carousel slide" data-ride="carousel">
			<!-- Indicators -->
			<ol class="carousel-indicators">
				<li class="active" data-target="#banner" data-slide-to="0"></li>
				<li class="" data-target="#banner" data-slide-to="1"></li>
				<li class="" data-target="#banner" data-slide-to="2"></li>
				<li data-target="#banner" data-slide-to="3" class=""></li>
			</ol>
			<!-- Wrapper for slides -->
			<div class="carousel-inner">
				<div class="item active">
                    <img src="${pageContext.request.contextPath}/static/img/okwu.jpg" alt="OKWU.edu Homepage">
                    <div class="carousel-caption">广告图片0001</div>
                </div>
                <div class="item">
                    <img src="${pageContext.request.contextPath}/static/img/okwu-athletics.jpg" alt="OKWU Athletics Homepage">
                    <div class="carousel-caption">广告图片0002</div>
                </div>
                <div class="item">
                    <img src="${pageContext.request.contextPath}/static/img/bartlesvillecf.jpg" alt="Bartlesville Community Foundation">
                    <div class="carousel-caption">广告图片0003</div>
                </div>
                <div class="item">
                    <img src="${pageContext.request.contextPath}/static/img/emancipation.jpg" alt="Emancipation Stories">
                    <div class="carousel-caption">广告图片0004</div>
                </div>
			</div>
			<!-- Controls -->
			<a class="left carousel-control" href="#banner" data-slide="prev"> 
				<span class="glyphicon glyphicon-chevron-left"></span> 
			</a> 
			<a class="right carousel-control" href="#banner" data-slide="next"> 
				<span class="glyphicon glyphicon-chevron-right"></span> 
			</a>
		</div>
	</div>
	
    <div class="col-md-6">
        <h4><strong>正在讨论</strong></h4>
        <ul class="list-group">
          <c:forEach var="t" items="${topic}">
	          <li class="list-group-item">
	          	<span class="badge">回复：${t.commentTimes}</span>
	          	<a href="http://localhost:8080/MyCommunity/topic/2">${t.title}</a>
	          </li>
          </c:forEach>
        </ul>
    </div>
</div>




<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
          <div class="panel-heading">智能手机OS讨论区</div>
        </div>
    </div>
</div>

<div class="row">
	
    <c:forEach var="f" items="${forums}">
    <c:if test="${f.parentId==1}">
    <div class="col-md-3">
       <div class="thumbnail">
          <img src="${pageContext.request.contextPath}/static/img/forum_${f.id}_icon.png" alt="">
          <h3 class="text-center"><a href="${pageContext.request.contextPath}/topic?fid=${f.id}">${f.name}</a></h3>
          <p>${f.description}</p>
        </div>
    </div>
    </c:if>
   </c:forEach>
</div>




<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
          <div class="panel-heading">公共资源分享区</div>
        </div>
    </div>
</div>

<div class="row">
	
    <c:forEach var="f" items="${forums}">
    <c:if test="${f.parentId==2}">
    <div class="col-md-3">
       <div class="thumbnail">
          <img src="${pageContext.request.contextPath}/static/img/forum_${f.id}_icon.png" alt="">
          <h3 class="text-center"><a href="${pageContext.request.contextPath}/topic?fid=${f.id}">${f.name}</a></h3>
          <p>${f.description}</p>
        </div>
    </div>
    </c:if>
   </c:forEach>
    
</div>


    	</div>
    
		
<footer id="footer" class="panel-footer">
    <p>手机论坛 xda.cn </p>
    <p>Designed by Sam Chen </p>
</footer>

    </div>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.js"></script>

</body></html>